package com.android.thought.badboys.Info;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Comparator;


public class MessageInfo implements Serializable , Comparator<MessageInfo>{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5072506704324800118L;

	public enum MESSAGE_TYPE { SMS , MMS_MIX , MMS_IMAGE, MMS_TEXT };
	
	int mId ;
	String mNumber;
	long mTime = 0;
	int mRead ;
	
	/**
	 * 메시지 타입 : 
	 * 
	 */
	MESSAGE_TYPE mMESSAGE_TYPE = MESSAGE_TYPE.SMS;
	
	/**
	 * MMS 일때 추가.
	 */
	ArrayList<byte[]> mBitmapBytes= new ArrayList<byte[]>();
	
	/**
	 * 1 : 수신  2: 발신
	 */
	int mType = -1;
	
	String mBody;
	
	public ArrayList<byte[]> getBitMap() {
		return mBitmapBytes;
	}
	
	public void addBitMapByte(byte[] bytes) {
		
		mBitmapBytes.add(bytes);
		
	}
	
	public void setId(int id) { 
		this.mId = id;
	}
	
	public void setNumber(String number) { 
		this.mNumber = number;
	}
	
	public void setBody(String body) { 
		this.mBody = body;
	}
	
	public void setDate(long time) { 
		this.mTime =  time;
	}
	
	public void setType(int type)  { 
		this.mType = type;
	}
	
	public void setRead(int read) { 
		this.mRead = read;
	}
	
	public int getId() { 
		return this.mId;
	}
	
	public String getNumber() { 
		return this.mNumber;
	}
	
	public String getBody() { 
		return this.mBody;
	}
	
	public long getDate() { 
		return this.mTime;
	}
	
	public int getType()  { 
		return this.mType;
	}
	
	public int getRead() { 
		return this.mRead;
	}
	
	public void setMessagType(MESSAGE_TYPE type) { 
		this.mMESSAGE_TYPE = type;
	}
	
	public MESSAGE_TYPE getMessageType() { 
		return this.mMESSAGE_TYPE;
	}

	@Override
	public int compare(MessageInfo lhs, MessageInfo rhs) {

		return (int)(( rhs.getDate() / 100 ) - (lhs.getDate() / 100));
	}
	
	
	
}
